//app.js
const util = require('/utils/util.js')
const appid = 'wxaacc4d201a5f3f45'
const secret = 'b451792bd3cd6b30691589b4d5d630a6'
// const jsCode = ''
App({
  onLaunch: function () {
    // 展示本地存储能力
    var logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    // 登录
    wx.login({
      success: res => {
        wx.request({
          url: 'https://beize.sdjfe.com/api/user/get_user', //仅为示例，并非真实的接口地址
          // method: 'GET',
          data: {
            jsCode: res.code,
          },
          header: {
            'content-type': 'application/json' // 默认值
          },
          success: function (res) {
          }
        })
      }
    })
  },
  globalData: {
    domain: 'https://beize.sdjfe.com/', //正式使用是https
    userInfo: null,
    openid: '',
    session_key: '',
    login: false, //登录状态，token过期为false
    cartIds: '', //订单id集合
    cartNames: '', //订单名集合
    seriesTitles: '', //订单型号集合
    amount: 0.00, //订单总金额
    wxdata: [], //微信返回信息
    order: [], //订单信息
    globalId: null,
    addressId: null,
    telephone: null,
    jsCode: null,
    payStatus: null
  }
})